﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
using System.Data.Common;

namespace DbHelp
{
    /// <summary>
    /// 没有继承自DbHelper
    /// </summary>
    public class MySqlHelper : DbHelper
    {
        public MySqlHelper()
        {
            try
            {
                base.ConnectionString = System.Configuration.ConfigurationManager.AppSettings.Get("MySqlConnStr").ToString();

                DbProviderFactory dbf = DbProviderFactories.GetFactory("MySql.Data.MySqlClient");
                base.ProviderFactory = dbf;
            }
            catch (Exception ex)
            {
                Log.Error("MySqlHelper(): " + ex.Message);
            }
        }
    }
}
